#include <iostream>
using namespace std;

const int kInf = 1e9;
const int kMaxN = 110;

int f[kMaxN][2];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int a;

    cin >> a;
    f[i][0] = f[i][1] = kInf;
    f[i][0] = min(f[i - 1][0] + 1, f[i - 1][1] + ((a & 1) == 0));
    f[i][1] = min(f[i - 1][1] + 1, f[i - 1][0] + ((a & 2) == 0));
  }
  cout << min(f[n][0], f[n][1]) << "\n";
  return 0;
}